home *** CD-ROM | disk | FTP | other *** search
/ Trusted Irix /B 4.0.4 / Trusted-Irix B-4.0.1.iso / dist / eoe1.idb / usr / include / sys / ht_tportnew.h.z / ht_tportnew.h
C/C++ Source or Header  |  1992-04-03  |  5KB  |  225 lines

  1. /**************************************************************************
  2.  *                                      *
  3.  *          Copyright (C) 1988, Silicon Graphics, Inc.          *
  4.  *                                      *
  5.  *  These coded instructions, statements, and computer programs  contain  *
  6.  *  unpublished  proprietary  information of Silicon Graphics, Inc., and  *
  7.  *  are protected by Federal copyright law.  They  may  not be disclosed  *
  8.  *  to  third  parties  or copied or duplicated in any form, in whole or  *
  9.  *  in part, without the prior written consent of Silicon Graphics, Inc.  *
  10.  *                                      *
  11.  **************************************************************************/
  12.  
  13. /*
  14. ** colors for the textport
  15. */
  16. #define LT_GRAY_R        200
  17. #define LT_GRAY_G        200
  18. #define LT_GRAY_B        200
  19.  
  20. #define MD_GRAY_R        112
  21. #define MD_GRAY_G        112
  22. #define MD_GRAY_B        128
  23.  
  24. #define SLATE_R            96
  25. #define SLATE_G            96
  26. #define SLATE_B            112
  27.  
  28. #define RASPBERRY_R          160
  29. #define RASPBERRY_G          0
  30. #define RASPBERRY_B          140
  31.  
  32. #define NEWS_ROOT_R        127
  33. #define NEWS_ROOT_G        158
  34. #define NEWS_ROOT_B        191
  35.  
  36. #define LT_BLUE_R        64
  37. #define LT_BLUE_G        64
  38. #define LT_BLUE_B        192
  39. /*
  40. ** color indices
  41. */
  42. #define SCR_IDX            8
  43. #define TP_IDX            9
  44. #define PNL_IDX            10
  45. #define LOG_IDX            11
  46. #define LOGO_START        16
  47.  
  48. #define    BORDER_COLOR        WHITE
  49. #define INR_BORDER        LOGO_START
  50. #define    CURSOR_COLOR        GREEN
  51.  
  52. #define PNL_DF_R        SLATE_R
  53. #define PNL_DF_G        SLATE_G
  54. #define PNL_DF_B        SLATE_B
  55.  
  56. #define TP_DF_R            SLATE_R
  57. #define TP_DF_G            SLATE_G
  58. #define TP_DF_B            SLATE_B
  59.  
  60. #define LOGO_DF_R        LT_BLUE_R
  61. #define LOGO_DF_G        LT_BLUE_G
  62. #define LOGO_DF_B        LT_BLUE_B
  63.  
  64. #define SCR_DF_R        NEWS_ROOT_R
  65. #define SCR_DF_G        NEWS_ROOT_G
  66. #define SCR_DF_B        NEWS_ROOT_B
  67.  
  68. /*
  69. ** sizes for the GR1 textport in its various modes
  70. */
  71. #define    TP_MAXROWS    40
  72. #define    TP_MAXCOLS    80    
  73. #define LOG_MAXROWS    TP_MAXROWS
  74.  
  75. #define    PNL_MAXROWS    20
  76. #define    PNL_MAXCOLS    80
  77.  
  78. /*
  79. ** ioctls for the host-implemented textport
  80. */
  81. #define HCTPCODE(c)        ('G'<<8|(c))
  82.  
  83. /*
  84. ** textport modes-- basic textport "TP", boot panel "PNL", and login panel "LOG"
  85. */
  86. #define TP_MODE            HCTPCODE(2)
  87. #define PNL_MODE        HCTPCODE(3)
  88. #define LOG_MODE        HCTPCODE(4)
  89. #define AUTO_INIT        HCTPCODE(5)
  90.  
  91. /*
  92. ** graphical characters recognized in the BOOT PANEL mode
  93. */
  94. #define        L_BRAK        ((char ) 1)
  95. #define        U_BAR        ((char ) 2)
  96. #define        O_BAR        ((char ) 5)
  97. #define        R_BRAK        ((char ) 6)
  98. #define        CLR_HOME    ((char ) 14)
  99.  
  100. /* The following macros are used by the text port emulator */
  101. #define IRIS10I_HT    16
  102. #define IRIS10I_DC    4
  103. #define    fontWidth     9
  104. #define TPFONTHT    IRIS10I_HT
  105.  
  106. #define BOX_HT        20
  107. #define    BOX_DC        6
  108.  
  109. #define    XBORDER    2
  110. #define    YBORDER    2
  111.  
  112. #define    XSIZE(cols)    ((cols) * fontWidth)
  113.  
  114. /*
  115. ** special graphics attributes and characters
  116. */
  117. #define        AT_UL        (1<<8)
  118. #define        AT_RV        (2<<8)
  119. #define        AT_BX        (4<<8)
  120. #define     IS_UL(c)    ((c) & AT_UL)
  121. #define     IS_RV(c)    ((c) & AT_RV)
  122. #define     IS_BX(c)    ((c) & AT_BX)
  123.  
  124. #define     IS_PRINTABLE(c)    (((c)>=' ') &&((c)<='\376'))
  125.  
  126. #define MAXAPARAMS 4
  127.  
  128. /* states */
  129. #define    CLEAN        0
  130. #define    SCROLLED    1
  131. #define    DIRTY        2
  132.  
  133. /* astates */
  134. #define NORM        0
  135. #define ESC        1
  136. #define CSI        2
  137.  
  138. /* flags */
  139. #define CURSOFF        1
  140.  
  141. /* Counter used for screen saver */
  142. #define    TP_TIMEOUT    (15*60*60)
  143.  
  144. /*
  145. ** structure of textport
  146.  */
  147.  
  148.     typedef struct row {
  149.         char    maxcol;                 /* last used column */
  150.         char    dirty;                  /* non-zero if row needs painting */
  151.         unsigned short data[TP_MAXCOLS];/* txport presumed larger than panel */
  152.     } row_t;
  153.  
  154.     typedef struct textport {
  155.         char    state;          /* see below */
  156.         char    astate;         /* see below */
  157.         short   llx, lly;       /* coordinates of lower window corner */
  158.         short   numrows;        /* number of rows displayed */
  159.         short   numcols;        /* number of columns displayed */
  160.         short   crow, ccol;     /* cursor row & column */
  161.         short   aparams[MAXAPARAMS];
  162.         short   aparamc;
  163.         short   aflags;
  164.         unsigned short  attribs;
  165.         row_t *row[TP_MAXROWS];
  166.         row_t rowd[TP_MAXROWS]; /* textport presumed bigger than panel */
  167.     } textport_t;
  168.  
  169.  
  170.     typedef struct tportstate {
  171.         int init_on_write;
  172.         int hints_inited;
  173.  
  174.         int tx_is_okay;
  175.         int xScreenSize, yScreenSize;
  176.  
  177.         int tx_showlogo;
  178.         int LOGO_X, LOGO_Y;
  179.  
  180.         int fontDescender;
  181.         int fontHeight;
  182.         int boot_panel_mode;
  183.  
  184.         int fgnd; 
  185.     int bgnd;
  186.  
  187.     int page_r, page_g, page_b;
  188.  
  189.         textport_t textport;
  190.     
  191.     void *hwbase;
  192.     int blank_ctr;
  193.     } tportstate_t;
  194.  
  195. /*
  196. ** procedural interface to the textport
  197. */
  198. extern int  keyboard_init();
  199. extern void ht_txPrint();
  200. extern void ht_txInit();
  201. extern void ht_txConfig();
  202. extern void ht_tx_set_ok();
  203. extern void ht_tx_not_ok();
  204. extern void ht_gfx_set_ok();
  205. extern void ht_gfx_not_ok();
  206. extern void ht_txScreenOn();
  207. extern int  ht_tx_ok();
  208. extern int  ht_gfx_ok();
  209. extern int  ht_txGfxInit();
  210.  
  211. /* text port functions */
  212. struct tp_fncs {
  213.         void    (*blankscreen)();
  214.         void    (*color)();
  215.         void    (*mapcolor)();
  216.         void    (*sboxfi)();
  217.         void    (*pnt2i)();
  218.         void    (*cmov2i)();
  219.         void    (*drawbitmap)();
  220.     void    (*hwinit)();
  221. };
  222.  
  223. extern struct tp_fncs *tp_fncs;
  224. extern tportstate_t    tp_bdata;
  225.